package ${package};

/**
* @version V1.0
* @author: zpc
* @date:
*/
@Service
public class ${service_class_name} {
@Resource
private ${mapper_class_name} mapper;


public PageVo getList(String keyWord,Integer page, Integer limit) {
List<${po_class_name}> list = mapper.list(keyWord,  (page-1)*limit, limit);
Integer count = mapper.count(keyWord);
return new PageVo(list, count);
}

// 添加风格 需要把现有题材的都进行同步
public void opearort(${po_class_name} po) {
if(po.getId==null){
po = new ${po_class_name}();
po.setCreatedTime(LocalDateTime.now());
po.setUpdatedTime(LocalDateTime.now());
po.setHasDelete(0);
po.setState(1);

mapper.insertSelective(po);

}else{
po.setUpdatedTime(LocalDateTime.now());
mapper.updateByPrimaryKey(po);
}


}

// 删除
public void remove(Integer id) {
mapper.deleteByPrimaryKey(id);

}

}
